<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg">
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div class="banner-number"><span class="iconfont">&#xe601;</span>
          {{this.bannerImgs.length}}
        </div>
      </div>
    </div>
    <fade-animation>
      <gallary :imgs="bannerImgs" v-show="showGallary" @close=handGallaryClose></gallary>
    </fade-animation>
  </div>
</template>

<script>
  import FadeAnimation from "../../../common/fade/FadeAnimation";
  import gallary from "../../../common/gallary/gallary";
  export default {
    name: "DetailBanner",
    components:{
      gallary,
      FadeAnimation
    },
    data(){
      return{
        showGallary:false,

      }
    },
    props:{
      sightName:String,
      bannerImg:String,
      bannerImgs:Array,
      list:Array
    },
    methods:{
      handleBannerClick(){
        this.showGallary = true
      },
      handGallaryClose(){
        this.showGallary = false
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .banner
    position relative
    height 0
    padding-bottom 55%
    overflow hidden
    .banner-img
      width 100%
    .banner-info
      display flex
      line-height .6rem
      position: absolute;
      right 0
      bottom 0
      left 0
      color #fff
      background-image: linear-gradient(top, rgba(0,0,0,0),
      rgba(0,0,0,0.8))
      .banner-title
        flex 1
        font-size .32rem
        padding .2rem
      .banner-number
        margin-top .3rem
        padding 0 .3rem
        border-radius .2rem
        height .32rem
        line-height .32rem
        background: rgba(0,0,0,0.8)
        font-size .24rem
        .banner-icon
          font-size:.24rem
</style>
